package payroll.trans;

import payroll.Employee;
import payroll.PaymentClassification;
import payroll.PayrollDatabase;
import payroll.method.HoldMethod;
import payroll.Transaction;
public abstract class AddEmployeeTransaction implements Transaction {
    
    private int empId;
    private String name;
    private String address;
    protected AddEmployeeTransaction(int empId, String name, String address) {
        this.empId = empId;
        this.name = name;
        this.address = address;
    }
    @Override 
    public void execute() {
        // Assuming Employee has a constructor that takes (int empId, String name, String address, double hourlyRate)
        Employee e = new Employee(empId, name, address);
        e.setPaymentClassification(getPaymentClassification());
        e.setPaymentMethod(new HoldMethod());
        PayrollDatabase.saveEmployee(e);
    }
    protected abstract PaymentClassification getPaymentClassification();
}
